import { IPSChartCalendar } from './ipschart-calendar';
import { IPSChartCoordinateSystemCalendar } from './ipschart-coordinate-system-calendar';
import { PSDEChartCoordinateSystemImplBase } from './psdechart-coordinate-system-impl-base';

export class PSDEChartCoordinateSystemCalendarImpl extends PSDEChartCoordinateSystemImplBase implements IPSChartCoordinateSystemCalendar {
  protected pschartcalendar: IPSChartCalendar | null = null;

  getPSChartCalendar(): IPSChartCalendar | null {
    if (this.pschartcalendar != null) return this.pschartcalendar;
    const value = this.M.getPSChartCalendar;
    if (value == null) {
      return null;
    }
    this.pschartcalendar = this.getPSModel4('control.chart.IPSChartCalendar', value, 'getPSChartCalendar') as IPSChartCalendar;
    return this.pschartcalendar;
  }

  get psChartCalendar(): IPSChartCalendar | null {
    return this.getPSChartCalendar();
  }

  getPSChartCalendarMust(): IPSChartCalendar {
    const value = this.getPSChartCalendar();
    if (value == null) {
      throw new Error('未指定地理坐标系组件');
    }
    return value;
  }

  get cls(): string {
    return 'PSDEChartCoordinateSystemCalendarImpl';
  }

  instanceof(cls: string): boolean {
    if (cls == 'control.chart.IPSChartCoordinateSystemCalendar') return true;
    return super.instanceof(cls);
  }
}
